package com.chenxi.controller;

import com.chenxi.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
public class DemoAController {

    @Autowired
    private DemoService demoService;

    @RequestMapping(path = "/current", method = RequestMethod.GET)
    public Principal getCurrentAccount(Principal principal) {
        return principal;
    }

    @RequestMapping(value = "getB")
    public String getB(){
        return demoService.getB();
    }
}
